var mongoose = require('mongoose');
var config = require('../config');

var db = mongoose.createConnection(config.mongodbString);

db.on('error', (error) => {
    console.error(error);
});

db.once('open', function() {
    console.log("Successful connection to " + config.mongodbString);
});

module.exports = db;
